//
//  myWindowController.m
//  ToolbarTest
//
//  Created by Junjie Gong on 12-5-26.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "myWindowController.h"
#import "ATBorderView.h"

@implementation myWindowController

@synthesize contentView;
@synthesize showPoint;

- (void)dealloc{
    
    [contentView release];
    
    [super dealloc];
}

- (id)init{
    if (self=[super initWithWindowNibName:@"myWindow"]) {
        
    }
    return self;
}

- (id)initWithWindow:(NSWindow *)window
{
    self = [super initWithWindow:window];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

- (void)windowDidLoad
{
    [super windowDidLoad];
    
    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
}

- (void)awakeFromNib{
    [super awakeFromNib];
    [self.window.contentView addSubview:self.contentView];
    
    [self.window setBackgroundColor:[NSColor clearColor]];
    [self.window setOpaque:NO];
    
    [self.window setFrameOrigin:showPoint];
    [self.window setLevel:NSStatusWindowLevel];
    
    NSWindow *mainw = [NSApp mainWindow];
    [mainw addChildWindow:self.window ordered:NSWindowAbove];
}



- (void)windowWillClose:(NSNotification *)notification{
    NSWindow *w = [NSApp mainWindow];
    [w removeChildWindow:self.window];
    [self autorelease];
}


- (IBAction)stopWindow:(id)sender{
    [self.window close];
}

@end
